package com.aspose.cells;

class zavg extends zbz {
   zavg(boolean var1) {
      this.c(4175);
      this.b(20);
      this.c = new byte[20];
      if (var1) {
         this.c[0] = 5;
      } else {
         this.c[0] = 2;
      }

      this.c[2] = 2;
   }

   void a(ChartFrame var1) throws Exception {
      if (var1.getWidth() + var1.getHeight() == 0) {
         var1.getChart().a(false, false);
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getX()), 0, this.c, 4, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getY()), 0, this.c, 8, 4);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getWidth()), 0, this.c, 12, 4);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getHeight()), 0, this.c, 16, 4);
   }

   int[] a(Legend var1) {
      int[] var2 = new int[2];
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getX()), 0, this.c, 4, 4);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getY()), 0, this.c, 8, 4);
      if (!var1.l()) {
         var2[0] = (int)((double)((float)var1.getWidth() / 4000.0F) * var1.getChart().getChartObject().getWidthPt() - (double)var1.a());
         var2[1] = (int)((double)((float)var1.getHeight() / 4000.0F) * var1.getChart().getChartObject().getHeightPt() - (double)var1.z());
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2[0]), 0, this.c, 12, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2[1]), 0, this.c, 16, 4);
         this.c[2] = 1;
      }

      return var2;
   }

   void a(Title var1) throws Exception {
      int var2;
      int var3;
      if (var1.d() == 3 && (var1.b() || var1.c())) {
         var1.getChart().a(false, false);
         var2 = var1.getX() - var1.getDefaultX();
         var3 = var1.getY() - var1.getDefaultY();
         System.arraycopy(com.aspose.cells.b.a.zc.a(var2), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var3), 0, this.c, 8, 4);
      } else if (var1.d() == 4 && (var1.b() || var1.c()) && var1.v != null && var1.v instanceof Axis) {
         var1.getChart().a(false, false);
         var2 = var1.getX() - var1.getDefaultX();
         var3 = var1.getY() - var1.getDefaultY();
         Axis var4 = var1.v;
         float var5 = (float)(var2 * var4.a().getChartObject().getWidth()) / 4000.0F;
         float var6 = (float)(var3 * var4.a().getChartObject().getHeight()) / 4000.0F;
         float var7 = (float)(var4.a().getPlotArea().getWidth() * var4.a().getChartObject().getWidth()) / 4000.0F;
         float var8 = (float)(var4.a().getPlotArea().getHeight() * var4.a().getChartObject().getHeight()) / 4000.0F;
         int var9 = (int)((double)(var5 * 1000.0F / var7) + 0.5D);
         int var10 = (int)((double)(var6 * 1000.0F / var8) + 0.5D);
         int var11 = 0;
         int var12 = 0;
         if (var4.c() == 0) {
            var10 = -var10;
            var11 = var9;
            var12 = var10;
         } else if (var4.c() == 1) {
            var9 = -var9;
            var10 = -var10;
            var11 = var9;
            var12 = var10;
         } else if (var4.c() == 3) {
            var10 = -var10;
            var11 = var10;
            var12 = var9;
         } else if (var4.c() == 2) {
            var11 = var10;
            var12 = var9;
         }

         System.arraycopy(com.aspose.cells.b.a.zc.a(var11), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var12), 0, this.c, 8, 4);
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.u()), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.v()), 0, this.c, 8, 4);
      }

      if (var1.getWidth() == 0) {
         this.c[12] = 25;
         this.c[16] = 23;
      } else {
         var2 = var1.w();
         var3 = var1.x();
         if (var2 == 0 || var3 == 0) {
            var1.getChart().a(false, false);
            var2 = var1.w();
            var3 = var1.x();
         }

         System.arraycopy(com.aspose.cells.b.a.zc.a(var2), 0, this.c, 12, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var3), 0, this.c, 16, 4);
      }

   }

   void a(DataLabels var1) throws Exception {
      int var2;
      int var3;
      if (!var1.b() && !var1.c()) {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.u()), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.v()), 0, this.c, 8, 4);
      } else {
         var1.getChart().a(false, false);
         var2 = var1.getX() - var1.getDefaultX();
         var3 = var1.getY() - var1.getDefaultY();
         float var4 = (float)(var2 * var1.getChart().getChartObject().getWidth()) / 4000.0F;
         float var5 = (float)(var3 * var1.getChart().getChartObject().getHeight()) / 4000.0F;
         float var6 = (float)(var1.getChart().getPlotArea().getWidth() * var1.getChart().getChartObject().getWidth()) / 4000.0F;
         float var7 = (float)(var1.getChart().getPlotArea().getHeight() * var1.getChart().getChartObject().getHeight()) / 4000.0F;
         int var8 = (int)((double)(var4 * 1000.0F / var6) + 0.5D);
         int var9 = (int)((double)(var5 * 1000.0F / var7) + 0.5D);
         if (var1.E() == 6) {
            var8 = -var8;
            var9 = -var9;
         }

         System.arraycopy(com.aspose.cells.b.a.zc.a(var8), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var9), 0, this.c, 8, 4);
      }

      var2 = var1.w();
      var3 = var1.x();
      if (var2 == 0 || var3 == 0) {
         var1.getChart().a(false, false);
         var2 = var1.w();
         var3 = var1.x();
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.w()), 0, this.c, 12, 4);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.x()), 0, this.c, 16, 4);
   }

   void a(DisplayUnitLabel var1) throws Exception {
      int var2;
      int var3;
      if (!var1.b() && !var1.c()) {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.u()), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.v()), 0, this.c, 8, 4);
      } else {
         var1.getChart().a(false, false);
         var2 = var1.getX() - var1.getDefaultX();
         var3 = var1.getY() - var1.getDefaultY();
         Axis var4 = var1.a();
         float var5 = (float)(var2 * var4.a().getChartObject().getWidth()) / 4000.0F;
         float var6 = (float)(var3 * var4.a().getChartObject().getHeight()) / 4000.0F;
         float var7 = (float)(var4.a().getPlotArea().getWidth() * var4.a().getChartObject().getWidth()) / 4000.0F;
         float var8 = (float)(var4.a().getPlotArea().getHeight() * var4.a().getChartObject().getHeight()) / 4000.0F;
         int var9 = (int)((double)(var5 * 1000.0F / var7) + 0.5D);
         int var10 = (int)((double)(var6 * 1000.0F / var8) + 0.5D);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var9), 0, this.c, 4, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var10), 0, this.c, 8, 4);
      }

      var2 = var1.w();
      var3 = var1.x();
      if (var2 == 0 || var3 == 0) {
         var1.getChart().a(false, false);
         var2 = var1.w();
         var3 = var1.x();
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.w()), 0, this.c, 12, 4);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.x()), 0, this.c, 16, 4);
   }
}
